<?php
function view_bimbel($config,$param){
view_header($config,array(
    'page' => 'bimbel',
));
$twitter = (strlen($param['twitter'])>0) ? $param['twitter'] : "";
if (count($param['slide'])>0){
	view_slide_wide('slider1', $param['slide']);
}
?>
<!--script social media-->
<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1&appId=147346958657510";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
<!--script social media-->
<div class="desc">
    <h1>
        sekolah
    </h1><br />
    <h1>
        seni rupa
    </h1>
    <div class="clear" style="height: 50px"></div>    
    <p><?php echo $param['deskripsi'] ?></p>
    <div class="clear"></div>
</div>
<div>
	<h2>Kirimkan melalui e-mail/langsung ke alamat bimbel</h2>
	<?php
		$uploaddir = $config['image_path'].'bimbel'.DIRECTORY_SEPARATOR;
		$regex = $uploaddir."download.*";
		//FILTER
		$file="";
		$files = glob($regex);
		if (count($files)>0){
			$files = $files[0];
			$getFile = explode(DIRECTORY_SEPARATOR,$files);
			$file = $getFile[count($getFile)-1];
			$file = $config['home_url']."asset/img/bimbel/".$file;
		}
	?>
    <a href="<?php echo $file;?>"><img src="<?php echo image_url ?>DOWNLOAD.gif" style="vertical-align: middle;border-radius: 100px;"></a>
    <?php view_contact($param['kontak']['telp'], $param['kontak']['email'], $param['kontak']['alamat']); ?>
</div>
<?php
	foreach ($param['kegiatan'] as $keg){
		?>
		<h3 class="agency subhide">
			<div id="<?php echo $keg['idBimbel']; ?>div"><a href="javascript:doubleToggle('<?php echo $keg['idBimbel']; ?>div','desc<?php echo $keg['idBimbel']; ?>')"><?php echo $keg['kegiatan']; ?></a></div>
		</h3>
		<div id="desc<?php echo $keg['idBimbel']; ?>" style="display: none;">
			<div style="float: left;margin: 0 20px 0 0;width: 200px;">
				<div>
					<div class="fb-like" data-href="http://<?php echo $_SERVER["SERVER_NAME"].$_SERVER['REQUEST_URI']; ?>" data-send="false" data-layout="button_count" data-width="450" data-show-faces="false" data-font="segoe ui"></div>
					<a href="https://twitter.com/share" class="twitter-share-button" data-text="Balerupa Bimbel (http://<?php echo $_SERVER["SERVER_NAME"].$_SERVER['REQUEST_URI']; ?>)" data-via="<?php echo $twitter; ?>" data-related="<?php echo $twitter; ?>">Tweet</a>
				</div>
				<p style="font-size: 12px;line-height: 125%;margin: 10px 0"><?php echo str_replace("\n", "<br />", $keg['deskripsi']); ?></p>
			</div>
			<div style="background-color: #cccccc;float: right;height: 300px;width: 500px;">
			<?php
				if (count($keg['slide'])>0){
					view_slide_narrow('slider'.$keg['idBimbel'], $keg['slide']);
				}
			?>
			</div>
			<div class="clear" style="height: 50px;"></div>
		</div>
<?php
	}
?>

<?php view_footer_2($config);
}
